package org.example.demo15_command.demo2;

public class AddButton implements AbstractButton{

    private ConnectionList connectionList;
    private String name;
    private String phoneNumber;

    public AddButton(ConnectionList connectionList, String name, String phoneNumber) {
        this.connectionList = connectionList;
        this.name = name;
        this.phoneNumber = phoneNumber;
    }

    @Override
    public void execute() {
        connectionList.add(name, phoneNumber);
    }
}
